import request from '@/config/axios'

export interface StaffInfoVO {
  id: number
  staffType: string
  dept: string
  staffId: string
  staffName: string
  gender: string
  job: string
  idCard: string
  status: string
  phone: string
  entryDate: string
  leaveDate: string
}

// 查询教职工信息列表
export const getStaffInfoPage = async (params) => {
  return await request.get({ url: `/university/staff-info/page`, params })
}

// 查询教职工信息详情
export const getStaffInfo = async (id: number) => {
  return await request.get({ url: `/university/staff-info/get?id=` + id })
}

// 新增教职工信息
export const createStaffInfo = async (data: StaffInfoVO) => {
  return await request.post({ url: `/university/staff-info/create`, data })
}

// 修改教职工信息
export const updateStaffInfo = async (data: StaffInfoVO) => {
  return await request.put({ url: `/university/staff-info/update`, data })
}

// 删除教职工信息
export const deleteStaffInfo = async (id: number) => {
  return await request.delete({ url: `/university/staff-info/delete?id=` + id })
}

// 导出教职工信息 Excel
export const exportStaffInfo = async (params) => {
  return await request.download({ url: `/university/staff-info/export-excel`, params })
}
